public class insertsort {
    public void insertSorta(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            int tem = arr[i];
            int j = i-1;
            for (  ; j >=0 ; j--) {
                if(arr[j]>tem){
                    arr[j+1] = arr[j];
                }
                else {
                    break;
                }
            }
            arr[j+1] = tem;
        }
    }
}
